<template>
    <div>
        <el-form ref="form" :model="form" label-width="150px" :disabled="form.disabled">
            <el-row>
                <el-col :span="18">
                    <el-form-item label="年度">
                        <el-date-picker
                          v-model="form.year"
                          type="year"
                          placeholder="选择年度">
                        </el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="18">
                    <el-form-item label="所属市县/区">
                       <el-cascader
                          v-model="form.shixian"
                          :options="data"
                          :props="{value: 'name', label: 'name', children: 'children', checkStrictly: true}"
                          ></el-cascader>
                   </el-form-item>
               </el-col>
                <el-col :span="18">
                    <el-form-item label="投资来源">
                       <el-select v-model="form.laiyuan" placeholder="请选择">
                          <el-option
                            v-for="item in investSourceList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="18">
                    <el-form-item label="年度水土流失治理面积（km²）">
                       <el-input v-model="form.nianduzhili" placeholder="年度水土流失治理面积"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="18">
                    <el-form-item label="梯田（km²）">
                       <el-input v-model="form.titian" placeholder="梯田"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="18">
                    <el-form-item label="水土保持林（km²）">
                       <el-input v-model="form.shuitubaochi" placeholder="水土保持林"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="18">
                    <el-form-item label="经济林（km²）">
                       <el-input v-model="form.jinji" placeholder="经济林"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="18">
                    <el-form-item label="种草（km²）">
                       <el-input v-model="form.zhongcao" placeholder="种草"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="18">
                    <el-form-item label="封禁治理（km²）">
                       <el-input v-model="form.fengjing" placeholder="封禁治理"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="18">
                    <el-form-item label="其他措施（km²）">
                       <el-input v-model="form.qita" placeholder="其他措施"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <div  class="dialog-footer"v-if="!form.disabled">
                <el-button @click="saveEdit">取 消</el-button>
                <el-button type="primary" @click="saveEdit">确 定</el-button>
            </div>
        </el-form>

         <!-- 关联项目 -->
        <el-dialog title="关联项目" :visible.sync="innerTableVisible" width="80%" append-to-body>
            <keepProgramBaseInfo @close="innerTableVisible = false" :form="form" :isComponent="true" type="programProcess"></keepProgramBaseInfo>
        </el-dialog>
    </div>
</template>
<script>
import {data} from '@/components/common/area';
import {GetFList} from '@/components/common/filter';
import keepProgramBaseInfo from '../keepProgramBaseInfo';
export default {
    components: {
        keepProgramBaseInfo
    },
    props: {
        editVisible: {
            default : false
        },
        form: {
            default: () => {},
        },
    },
    data() {
        return{
            investSourceList: GetFList('investSource'),
            data: data,
            innerTableVisible: false,
        }
    },
    methods: {
        saveEdit() {
            this.$emit('close')
        }
    }
}
</script>
<style scoped>
    .dialog-footer {
        text-align: right
    }
</style>